﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace SpaceInvade
{
    class PlayerInfo
    {
        public List<Keys> ControlKeys = new List<Keys>();
        public static List<Texture2D> lstShipIcons = new List<Texture2D>();
        public Texture2D ShipIcon = null;
        public long PlayerScore;
        public byte PlayerLives;

        private int SelectedType = 0;
        public int ShipType
        {
            set
            {
                SelectedType = value;
                if (SelectedType < 0)
                    SelectedType = lstShipIcons.Count - 1;
                else if (SelectedType >= lstShipIcons.Count)
                    SelectedType = 0;

                ShipIcon = lstShipIcons[SelectedType];
            }

            get
            {
                return SelectedType;
            }
        }

        public int ShipColor = 0;
        public bool InUse = false;

        public PlayerInfo()
        {
            for (int x = 0; x < 6; x++)
                ControlKeys.Add(new Keys());
            
            ClearKeys();
        }
        public void ClearKeys()
        {
            ControlKeys[0] = Keys.Left;
            ControlKeys[1] = Keys.Right;
            ControlKeys[2] = Keys.Up;
            ControlKeys[3] = Keys.Down;
            ControlKeys[4] = Keys.Space;
            ControlKeys[5] = Keys.LeftAlt;
        }
    }

    class GameInfo
    {
        public List<PlayerInfo> lstPlayers = new List<PlayerInfo>(4);
        int ItemDifficulty;
        int EnemyDifficulty;

        public GameInfo()
        {
            for(int x = 0; x < 4; x++)
                lstPlayers.Add(new PlayerInfo());

            lstPlayers[0].InUse = true;
        }
    }
}
